Skip to main content

Aztec Testnet Sequencer Setup Guide

This guide will help you set up an Aztec Protocol sequencer node on the alpha testnet using Docker Compose. As a sequencer, you'll be responsible for ordering transactions, producing blocks, and maintaining the network's operation while earning rewards for your contributions.

Prerequisites

System Requirements

  • Operating System: Ubuntu 22.04/24.04 LTS x64 (or any Docker-compatible OS)
  • CPU: 8+ cores recommended
  • Memory: 16GB RAM minimum
  • Storage: 500GB SSD (expandable as needed)
  • Network: Stable, high-quality internet connection with reliable RPC access
  • Software: Docker and Docker Compose installed
  • Access: Root or sudo privileges

Network Information

ComponentValueDescription
NetworkAztec Alpha TestnetCurrent alpha testing network
EnvironmentAlpha TestingActive testing phase
Node TypeSequencerOrders transactions and produces blocks
DeploymentDocker ComposeContainerized deployment
Version1.2.1Current stable version

Required Credentials

Before setting up your sequencer, you need:

  1. Validator Private Keys: Multiple Ethereum private keys for validator operations (minimum 3 recommended)
  2. L1 Private Key: Ethereum private key for gas payments and L1 operations
  3. Coinbase Address: Ethereum address to receive block rewards
  4. L1 Execution RPC URL: Reliable Ethereum mainnet RPC endpoint
  5. L1 Consensus RPC URL: Ethereum consensus layer RPC endpoint
tip

This guide uses Docker Compose for easy deployment and management. For detailed official documentation, visit: https://docs.aztec.network/the_aztec_network/guides/run_nodes/how_to_run_sequencer

warning

Important: Unstable or low-quality RPC connections will significantly impact sequencer performance. Ensure you have access to reliable Ethereum RPC endpoints before proceeding.

Architecture Overview

The Aztec sequencer setup consists of several key components:

  • Sequencer Node: Main coordinator responsible for transaction ordering and block production
  • Archiver: Maintains historical data and synchronizes with the L1 chain
  • P2P Network: Handles peer-to-peer communication with other network nodes
  • L1 Bridge: Manages interaction with Ethereum mainnet for settlements
tip

The following commands are executed as root by default. If you are not a root user, please prepend the commands with sudo.

Update System Packages

sudo -i

# Update package list and install required tools
apt update
apt install -y make git-core libssl-dev pkg-config build-essential protobuf-compiler libudev-dev curl jq wget aria2

Step 1: Prepare Your Environment

Install Docker and Docker Compose

# Update system packages and install prerequisites
apt-get install ca-certificates curl

# Add Docker's official GPG key
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null

# Update package list and install Docker
apt-get update
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

# Start and enable Docker service
systemctl start docker
systemctl enable docker

# Verify installation
docker --version
docker compose version

Create Project Directory

# Create project directory with data subdirectory
mkdir -p /data/aztec-sequencer/data && cd /data/aztec-sequencer

Step 2: Configure Your Sequencer

Set Environment Variables

# Set your configuration variables
export VERSION=1.2.1
export P2P_IP=YOUR_SERVER_PUBLIC_IP
export L1_EXECUTION_HOST_URL=YOUR_ETHEREUM_RPC_URL
export L1_CONSENSUS_HOST_URL=YOUR_CONSENSUS_RPC_URL
export VALIDATOR_PRIVATE_KEYS=YOUR_PRIVATE_KEY01,YOUR_PRIVATE_KEY02,YOUR_PRIVATE_KEY03
export L1_PRIVATE_KEY=YOUR_L1_PRIVATE_KEY_FOR_GAS_PAYMENTS
export COINBASE_ADDRESS=YOUR_COINBASE_ADDRESS

Create Environment Configuration

Create a .env file with your configuration:

cat > .env << EOF
# Aztec Sequencer Configuration
VERSION=${VERSION}
P2P_IP=${P2P_IP}
L1_EXECUTION_HOST_URL=${L1_EXECUTION_HOST_URL}
L1_CONSENSUS_HOST_URL=${L1_CONSENSUS_HOST_URL}
VALIDATOR_PRIVATE_KEYS=${VALIDATOR_PRIVATE_KEYS}
L1_PRIVATE_KEY=${L1_PRIVATE_KEY}
COINBASE_ADDRESS=${COINBASE_ADDRESS}

# Port Configuration
SEQ_P2P_PORT=40400
SEQ_RPC_PORT=8080
EOF

Configuration Parameters:

  • VERSION: Aztec protocol version to use
  • P2P_IP: Your server's public IP address for P2P connectivity
  • L1_EXECUTION_HOST_URL: High-quality Ethereum execution layer RPC endpoint
  • L1_CONSENSUS_HOST_URL: Ethereum consensus layer RPC endpoint
  • VALIDATOR_PRIVATE_KEYS: Comma-separated list of validator private keys
  • L1_PRIVATE_KEY: Private key for L1 operations and gas payments
  • COINBASE_ADDRESS: Address to receive block production rewards

Create Docker Compose Configuration

Create a docker-compose.yaml file:

cat > docker-compose.yaml << 'EOF'
x-logging: &logging
driver: "json-file"
options:
max-size: "10m"
max-file: "3"

name: aztec-sequencer
services:
sequencer-node:
network_mode: host
image: aztecprotocol/aztec:${VERSION}
restart: always
environment:
ETHEREUM_HOSTS: ${L1_EXECUTION_HOST_URL}
L1_CONSENSUS_HOST_URLS: ${L1_CONSENSUS_HOST_URL}
DATA_DIRECTORY: /data
VALIDATOR_PRIVATE_KEYS: ${VALIDATOR_PRIVATE_KEYS}
L1_PRIVATE_KEY: ${L1_PRIVATE_KEY}
P2P_IP: ${P2P_IP}
LOG_LEVEL: info
COINBASE: ${COINBASE_ADDRESS}
P2P_MAX_TX_POOL_SIZE: 1000000000
OTEL_RESOURCE_ATTRIBUTES: "aztec.node_role=sequencer,aztec.registry_address=0x4d2cc1d5fb6be65240e0bfc8154243e69c0fb19e"
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT: "https://telemetry.alpha-testnet.aztec.network/v1/metrics"
entrypoint: >
sh -c 'node --no-warnings /usr/src/yarn-project/aztec/dest/bin/index.js start --network alpha-testnet --node --archiver --sequencer'
ports:
- ${SEQ_P2P_PORT}:40400/tcp
- ${SEQ_P2P_PORT}:40400/udp
- ${SEQ_RPC_PORT}:8080
volumes:
- /data/aztec-sequencer/data:/data
logging: *logging
EOF

Configure Firewall

Open the required ports for sequencer operations:

# Allow P2P port for sequencer node
ufw allow ${SEQ_P2P_PORT} comment "Aztec sequencer P2P port"

# Verify firewall rules
ufw status

Step 3: Deploy and Start

Start the Sequencer Node

# Start the sequencer service
docker compose up -d

# Verify container is running
docker compose ps

Verify Deployment

# Check container status
docker compose ps

# View real-time logs
docker compose logs -f sequencer-node

# Check recent logs (last 100 lines)
docker compose logs --tail=100 sequencer-node

Expected Log Output:

sequencer-node | Starting Aztec sequencer node...
sequencer-node | Connected to alpha-testnet
sequencer-node | P2P network initialized on IP: YOUR_P2P_IP
sequencer-node | Sequencer started successfully
sequencer-node | Archiver synchronizing...

Step 4: Verify Synchronization

Check L2 Synchronization Status

# Check if the node is synchronized with the L2 network
curl -s -X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"node_getL2Tips","params":[],"id":67}' \
127.0.0.1:8080 | jq -r ".result.proven.number"

Expected Example Output:

4637

If you see a number output, your sequencer is running successfully and synchronized with the network.

Step 5: Validator Registration

Once your sequencer is synchronized, you can register as a validator to participate in consensus.

  1. Access the Testnet Portal:

  2. Complete ZKPassport Verification:

    • Follow the authentication prompts
    • Complete the verification process
    • This may include identity verification steps
  3. Join Validator Queue:

Option 2: Command Line Registration

# Set your validator address
export VALIDATOR_ADDRESS=YOUR_VALIDATOR_ADDRESS

# Register as validator using CLI
docker run --rm -ti aztecprotocol/aztec:${VERSION} aztec add-l1-validator \
--staking-asset-handler=0xF739D03e98e23A7B65940848aBA8921fF3bAc4b2 \
--l1-rpc-urls ${L1_EXECUTION_HOST_URL} \
--l1-chain-id 11155111 \
--private-key ${L1_PRIVATE_KEY} \
--attester ${VALIDATOR_ADDRESS} \
--proposer-eoa ${VALIDATOR_ADDRESS} \
--p2p.p2pIp ${P2P_IP}
info

Validator Queue System: There is a daily quota for validators to maintain network health. If you cannot join immediately, it means today's quota has been reached. Check the queue status and try again the next day.

Step 6: Monitor Your Sequencer

Performance Monitoring

# Real-time resource usage
docker stats sequencer-node

# Monitor sequencer logs for block production
docker compose logs -f sequencer-node

# Check node health
curl -s http://localhost:8080/status

Network Status Checks

# Check L2 tips and block height
curl -s -X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"node_getL2Tips","params":[],"id":67}' \
127.0.0.1:8080 | jq

# Check node information
curl -s -X POST -H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","method":"node_getNodeInfo","params":[],"id":67}' \
127.0.0.1:8080 | jq

Validator Queue Status

# Check your position in the validator queue
echo "Check your validator queue status at: https://dashtec.xyz/queue"

Step 7: Optimization and Troubleshooting

Performance Optimization

# Increase transaction pool size for higher throughput
sed -i 's/P2P_MAX_TX_POOL_SIZE: 1000000000/P2P_MAX_TX_POOL_SIZE: 2000000000/' docker-compose.yaml

# Restart to apply changes
docker compose up -d

Resource Tuning

For better performance, you can adjust Docker resource limits:

# Add to sequencer-node service in docker-compose.yaml
deploy:
resources:
limits:
cpus: '8'
memory: 16g
reservations:
cpus: '4'
memory: 8g

Common Issues and Solutions

1. Synchronization Issues

# Check if RPC endpoints are responsive
curl -X POST -H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
${L1_EXECUTION_HOST_URL}

2. P2P Connectivity Issues

# Test P2P port accessibility
telnet ${P2P_IP} ${SEQ_P2P_PORT}

Step 8: Maintenance and Updates

Regular Maintenance

# Monitor logs for errors
docker compose logs --since 24h sequencer-node | grep -i "error\|warn"

# Check disk space usage
df -h /data/aztec-sequencer/*

Updating Sequencer Version

# Stop current services
docker compose down

# Update version in .env file
sed -i 's/VERSION=1.2.1/VERSION=NEW_VERSION/' .env

# Pull latest images and restart
docker compose pull
docker compose up -d

Earning Rewards

How Sequencer Rewards Work

  • Block Production: Earn rewards for successfully producing and proposing blocks
  • Transaction Fees: Collect fees from transactions included in your blocks
  • Network Participation: Consistent uptime and performance increase earning potential
  • Validator Status: Active validators earn additional rewards for consensus participation

Maximizing Earnings

  1. Maintain High Uptime: Keep your sequencer running consistently
  2. Optimize Performance: Ensure adequate CPU, memory, and network resources
  3. Use Quality RPC: Reliable RPC connections improve block production success
  4. Monitor Queue Status: Stay informed about validator queue position and status
  5. Network Participation: Actively participate in network consensus and governance

Support Resources

For help and support with Aztec sequencer setup:


info

This setup creates a production-ready Aztec sequencer node that will participate in transaction ordering, block production, and network consensus while earning rewards for your contributions.

warning

Important Notes:

  • Keep all private keys secure and backed up
  • Monitor your sequencer regularly for optimal performance
  • Ensure stable internet connection and quality RPC access for consistent block production
  • Update your sequencer software regularly for the latest features and security patches
  • Be aware of the daily validator quota system when registering